package com.atguigu.yygh.enums;

public enum StatusEnum {
    //"状态（0：锁定 1：正常）"
    LOCK(0, "锁定"),
    NORMAL(1, "正常");
    private Integer code;
    private String message;

    StatusEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public Integer getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public void setMessage(String message) {
        this.message = message;
    }
    public static String getStatusNameByCode(Integer code) {
        for (StatusEnum statusEnum : StatusEnum.values()) {
            if (code.intValue()==statusEnum.getCode().intValue()){
                return statusEnum.getMessage();
            }
        }
        return "";
    }
}
